package com.googlecode.jtoy.patterns.observer;

/**
 * @author shangxj
 * @date 6:45:27 PM, Jul 16, 2011
 */
public class MockTimeSink implements Observer {

	private int hours;
	private int minutes;
	private int seconds;

	private TimeSource source;

	public MockTimeSink(TimeSource source) {
		this.source = source;
	}

	@Override
	public void update() {
		this.hours = source.getHours();
		this.minutes = source.getMinutes();
		this.seconds = source.getSeconds();
	}

	/** (getter for hours) */
	public int getHours() {
		return this.hours;
	}

	/** (getter for minutes) */
	public int getMinutes() {
		return this.minutes;
	}

	/** (getter for seconds) */
	public int getSeconds() {
		return this.seconds;
	}

}
